<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>My JSP 'createlab.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>css/style.css">
	<script type="text/javascript" src="<%=basePath%>js/jquery-1.8.3.js"></script>
	 <script type="text/javascript" src="<%=basePath%>My97DatePicker/WdatePicker.js"></script>
  </head>
  <body>
  <ul id="tabsmenu" class="tabsmenu">
        <li class="active"><a>删除实验室</a></li>
    </ul>
    <div id="tab1" class="tabcontent">
        <h3></h3>
        <div class="form">
            <form action="deleteLab.action" method="post">
            <div class="form_row">
            <label>实验室：</label>
            	<select id="labelRoom" class="form_input" status="false" name="labid" >
            		<option value="0" >---------请选择---------</option>
            	</select>
            </div>
            <div class="form_row">
            <input type="submit" class="form_submit" value="Submit" />
            </div>
            <div class="clear"></div>
            </form>
        </div>
    </div>
  </body>
  <script type="text/javascript">
	$(document).ready(function(){
		var status = $("#labelRoom").attr("status");
		if("false"==status){
			$.ajax({
				type : "post",
				url : "ajaxlab.action",
				dataType: "json",
				success : function (data){
					var content = "";
					$.each(data,function(i,item){
						var LId = item["LId"];
						var labName = item["labName"];
						content += "<option value='"+LId+"'>"+labName+"</option>";
					});
					$("#labelRoom").append(content);
					$("#labelRoom").attr("status","true");
				},
				error : function (XMLHttpRequest, textStatus, errorThrown){
        			console.info(errorThrown);
    			}
			});
		}
	});
</script>
</html>
